import { Table } from 'antd';
import React, { Component } from 'react';
import styles from './simpletable.less';

const columns = [
  {
    title: '设备id',
    dataIndex: 'devId',
    key: 'devId',
    sorter: true,
    width: '30%',
  },
  {
    title: '设备名',
    dataIndex: 'devName',
    key: 'devName',
    width: '30%',
  },
  {
    title: '车辆组',
    dataIndex: 'vehGroup',
    key: 'vehGroup',
  },
];

export default class SimpleTable extends Component {
  state = {
    pagination: {},
    loading: false,
  };

  componentDidMount() {
    //console.log('data', this.state.pagination);
    // this.fetch();
  }

  render() {
    return (
      <Table
        columns={columns}
        rowKey="devId"
        dataSource={this.props.data}
        pagination={this.state.pagination}
        loading={this.state.loading}
        className={styles.table}
      />
    );
  }
}
